{extend name="common/base" /}
{block name='page'}auth-login{/block}
{block name="quiz"}{/block}

{block name="main"}

<div class="weui_cells_title">注册帐号</div>
<div class="weui_cells weui_cells_form">
    <form id="register-form">
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">email</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input" placeholder="请输入email" type="email" name="email">
            </div>
            <div class="weui_cell_ft">
                    <i class="weui_icon_warn"></i>
                </div>
        </div>
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">昵称</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input" placeholder="将用于对外称呼" type="text" name="username">
            </div>
            <div class="weui_cell_ft">
                    <i class="weui_icon_warn"></i>
                </div>
        </div>
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">密码</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input" placeholder="请输入密码" type="password" name="password" required />
            </div>
        </div>
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">确认</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="weui_input" placeholder="请确认密码" type="password" name="repassword" required />
            </div>
        </div>
        <div class="weui_btn_area">
            <input class="weui_btn weui_btn_primary" type="submit" onclick="return register_submit();" value="提交"></input>
        </div>
    </form>

</div>

<div class="weui_cells_title">您还可以使用其他登录方式</div>
<div class="weui_btn_area">
    <a class="weui_btn weui_btn_default" href="javascript:" id="showTooltips">使用天佑互联登陆</a>
</div>
<div class="weui_cells_tips">在登陆过程中，您将会暂时跳转至站外页面</div>

<script type="text/javascript">
$('.home').removeClass('index');
$('body').attr('id','page-user-login');
</script>

{/block}

{block name="js"}
<script type="text/javascript">
function register_submit() {
    $.post('{:url("user/register")}', $('#register-form').serialize(), function(data, textStatus, xhr) {
        console.log(data);
    });
    return false;
}
</script>
{/block}